<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>admin_index</title>
    <link href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
    <style>
        body {
            background-color: aliceblue;
        }
    </style>
</head>
<body>
<br>
<br><br>
<div class="ui two column centered grid">
    <div class="column">
        <div class="ui action input">
            <a class="larger ui green button" th:href="@{/index}">返回</a>&nbsp;
            <a class="larger ui red button" th:href="@{/to_admin_add}">添加</a>&nbsp;
            <form class="ui form" th:action="@{/admin_search}" th:method="post">
                <div class="ui input focus">
                    <input name="keyword" placeholder="搜索..." type="text">
                </div>
                <button class="ui primary blue button">搜索</button>
            </form>
        </div>
        <table class="ui celled table">
            <thead>
            <tr>
                <th>ID</th>
                <th>管理员</th>
                <th>性别</th>
                <th>密码</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="admin,it:${adminList}">
                <td th:text="${admin.id}"></td>
                <td th:text="${admin.name}"></td>
                <td th:text="${admin.sex}"></td>
                <td th:text="${admin.password}"></td>
                <td>
                    <button class="ui small button">
                        <a href="/to_admin_update" th:href="@{/to_admin_update(id=${admin.id})}">更新</a>
                    </button>
                    <button class="ui small button">
                        <a href="/to_admin_delete" style="color: red;"
                           th:href="@{/to_admin_delete(id=${admin.id})}">删除</a>
                    </button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
